﻿using System.Collections.Generic;

using ARCHFORME.Common;
using ARCHFORME.Core;

namespace Core.Tests
{
    class CommandServiceBuilder
    {
        private readonly Dictionary<ICommand, IHandleCommand<ICommand>> handlerRegistry = new Dictionary<ICommand, IHandleCommand<ICommand>>();

        public CommandServiceBuilder Register(ICommand command, IHandleCommand<ICommand> handler)
        {
            handlerRegistry.Add(command, handler);
            return this;
        }

        public CommandService Build()
        {
            return new CommandService(handlerRegistry);
        }
    }
}